/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.client.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.logging.Logger;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author Gauthier
 */
@Entity
@Table(name = "TB_commande")
        @NamedQueries({
        @NamedQuery(name="Commande.findcommande", query="SELECT b FROM Commande b")})
public class Commande implements Serializable {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="ID_commande", nullable=false)
    private Integer ID_commande;
    
    @Column(name="Types")
    @Enumerated(EnumType.STRING)
    private EtatCommande etat = EtatCommande.Validée;
    
    @Column(name="ID_utilisateur")
    private Integer ID_utilisateur;
    
    @OneToMany(mappedBy = "commande")
    private List<CommandeLivre> commandeLivre;

    public Commande() {
        
    }

    public Commande(Integer utilisateur) {
        this.ID_utilisateur = utilisateur;
    }

    public Integer getID_commande() {
        return ID_commande;
    }

    public void setID_commande(Integer ID_commande) {
        this.ID_commande = ID_commande;
    }

    public EtatCommande getEtat() {
        return etat;
    }

    public void setEtat(EtatCommande etat) {
        this.etat = etat;
    }

    public Integer getID_utilisateur() {
        return ID_utilisateur;
    }

    public void setID_utilisateur(Integer ID_utilisateur) {
        this.ID_utilisateur = ID_utilisateur;
    }

}
